package com.general.framework.core.enums;


import com.general.framework.core.lang.Numbers;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

/**
 * 删除状态(0正常,1删除)
 */
public enum DelFlagEnum {

    normal(Numbers.INTEGER_ZERO, "正常"),
    delete(Numbers.INTEGER_ONE, "删除");

    private Integer value;
    private String desc;

    DelFlagEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        for (DelFlagEnum thisEnum : DelFlagEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }
}
